package com.ywjh.inter.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ywjh.inter.common.SystemConfig;

import net.sf.json.JSONObject;

public class Config extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5059692606203040136L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setCharacterEncoding("UTF-8");
		resp.setContentType("text/html; charset=utf-8");
		int r = 1;
		String e = "";
		JSONObject d = new JSONObject();
		d.put("app_name", SystemConfig.APP_NAME);
		d.put("client_id", SystemConfig.CLIENT_ID);
		d.put("client_secert", SystemConfig.CLIENT_SECERT);
		d.put("ori", SystemConfig.ORI);
		d.put("hx_url", SystemConfig.HX_URL);
		JSONObject json = new JSONObject();
		json.put("r", r);
		json.put("e", e);
		json.put("d", d);
		PrintWriter pw = resp.getWriter();
		pw.write(json.toString());
		pw.flush();
		pw.close();
	}

}
